<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>云启天赋-后台 | 登录</title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <!-- Bootstrap 3.3.6 -->
    <link rel="stylesheet" href="{{__BASE__}}/admin/bootstrap/css/bootstrap.min.css">
    <!-- Font Awesome -->
    <link rel="stylesheet" href="{{__BASE__}}/admin/bootstrap/font-awesome-4.5.0/css/font-awesome.min.css">
    <!-- Ionicons -->
    <link rel="stylesheet" href="{{__BASE__}}/admin/bootstrap/ionicons-2.0.1/css/ionicons.min.css">
    <!-- Theme style -->
    <link rel="stylesheet" href="{{__BASE__}}/admin/dist/css/AdminLTE.min.css">
    <!-- iCheck -->
    <link rel="stylesheet" href="{{__BASE__}}/admin/plugins/iCheck/square/blue.css">

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="{{__BASE__}}/admin/bootstrap/html5shiv/html5shiv.min.js"></script>
    <script src="{{__BASE__}}/admin/bootstrap/respond-1.4.2/respond.min.js"></script>
    <![endif]-->
    <style>
        .colorred{
            color:red;
        }
    </style>
</head>
<body class="hold-transition login-page">
<div class="login-box">
    <div class="login-logo">

    </div>
    <!-- /.login-logo -->
    <div class="login-box-body">
        <p class="login-box-msg">
            <a href="{{__BASE__}}"><img style="width:250px;" src="/home/images/logo.png" alt=""></a>
        </p>

        <form action="/admini/log/check" method="post" id="login-form">
            <div class="form-group login-form-show-error has-error colorred" <?php echo !empty($data['error']) ? 'style="display:block;"' : '';?>><?php echo !empty($data['error']) ? $data['error'] : '';?></div>
            <div class="form-group has-feedback">
                <input type="text" name="username" class="form-control" placeholder="账号" value="{{$data['login']['username'] or ''}}">
                <span class="glyphicon glyphicon-user form-control-feedback"></span>
                <input type="hidden" name="_token" value="{{ csrf_token() }}">
            </div>
            <div class="form-group has-feedback">
                <input type="password" name="password" value="{{$data['login']['password'] or ''}}" class="form-control" placeholder="密码">
                <span class="glyphicon glyphicon-lock form-control-feedback"></span>
            </div>
            <div class="form-group has-feedback">
                <input type="text" name="captcha" class="form-control" value="{{$data['login']['captcha'] or ''}}" placeholder="验证码">
                <span class="glyphicon glyphicon-lock form-control-feedback"></span>
            </div>
            <div class="form-group has-feedback">
                <img src="/admini/captcha" alt="验证码" class="imgCaptcha">
                <span style="margin-left:30px;"><a href="javaScript:void(0);" class="makeNewCaptcha">看不清 ? 点击更换</a></span>
            </div>
            <div class="row">
                <div class="col-xs-8">
                    <div class="checkbox icheck">
                    </div>
                </div>
                <!-- /.col -->
                <div class="col-xs-4">
                    <input type="submit" name="submit" class="btn btn-primary btn-block btn-flat" value="登 录" />
                </div>
                <!-- /.col -->
            </div>
        </form>
    </div>
    <!-- /.login-box-body -->
</div>
<!-- /.login-box -->

<!-- jQuery 2.2.0 -->
<script src="{{__BASE__}}/admin/plugins/jQuery/jQuery-2.2.0.min.js"></script>
<!-- Bootstrap 3.3.6 -->
<script src="{{__BASE__}}/admin/bootstrap/js/bootstrap.min.js"></script>
<!-- iCheck -->
<script src="{{__BASE__}}/admin/plugins/iCheck/icheck.min.js"></script>
<!-- jquery-validator -->
<script src="{{__BASE__}}/admin/plugins/jquery-validate/jquery.validate.min.js"></script>
<script src="{{__BASE__}}/admin/plugins/jquery-validate/localization/messages_zh.min.js"></script>
<script src="{{__BASE__}}/admin/dist/js/form-validate/login.js"></script>
<script>
    $(function () {
        $('input').iCheck({
            checkboxClass: 'icheckbox_square-blue',
            radioClass: 'iradio_square-blue',
            increaseArea: '20%' // optional
        });

        //刷新验证码
        $(".makeNewCaptcha").on("click",function(){
            var url = $(".imgCaptcha").attr("src");
            url = url.split("?");
            var queryStr = url[1] == undefined ? 1 : parseInt(url[1]) + 1;
            url = url[0] + "?" + queryStr;
            $(".imgCaptcha").attr("src",url);
        });
    });
</script>
</body>
</html>
